import { ModuleWithProviders }  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
//Risk Company
import { CompanyRiskComponent } from './companyRiskRating/companyRisk.component';
import { CompanyRiskSummaryComponent } from './companyRiskRating/summary/summary.component';
import { RiskSubIndustryComponent } from './companyRiskRating/subIndustry/subIndustry.component';
import { RiskMeiComponent } from './companyRiskRating/mei/mei.component';
//Risk Listing
import { ListingRiskComponent } from './listingRiskRating/listingRisk.component';

// Route Configuration
export const routes: Routes = [  
  { path: '', redirectTo: '/riskRating', pathMatch: 'full' },
  { path: 'riskRating', component: ListingRiskComponent }, //listing
  { path: 'riskRating/:company/:coverageEntityName', component: CompanyRiskComponent,  children: [
      { path: '', redirectTo: 'summary', pathMatch: 'full' },
      { path: 'summary', component: CompanyRiskSummaryComponent},
      { path: 'mei/:externalId/:type', component: RiskMeiComponent },
      { path: 'subindustry', component: RiskSubIndustryComponent }      
  ]} //company specific
];

//useHash is for IE9 compatibility
export const Routing: ModuleWithProviders = RouterModule.forRoot(routes, {useHash: true});